﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace MvcWeb
{
    public class AuthCode
    {

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "GenerateMachineCode", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr GenerateMachineCode(StringBuilder ProductId, StringBuilder Version);

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "GenerateKey", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr GenerateKey(StringBuilder ProductId, StringBuilder MachineCode);

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "VerifiKey", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr VerifiKey(StringBuilder keyFileName, StringBuilder ProductId, StringBuilder Version);

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "VerifiMachineKey", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr VerifiMachineKey(StringBuilder KeyPath);

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "VerifiKeyByFile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr VerifiKeyByFile(StringBuilder MCodePath, StringBuilder SKeyPath);

        [DllImport("SailHeroSoftAuthorization", EntryPoint = "VerifiKeyOnly", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr VerifiKeyOnly(StringBuilder SKeyPath);


    }
}
